<?php

	session_start();

	include('functions.php');
	
	$congress = obtenerCongress($_SESSION['idcongress']);

	$bgcolor = $congress['BACKGROUND_COLOR'];

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

	<title><?php echo $congress['NAME']; ?></title>

	<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
	<link href="accordion/style.css" rel="stylesheet" type="text/css" media="screen" />

	<script src="accordion/accordian.pack.js" language="javascript" type="text/javascript">
	</script>

	<style>
		body {
			padding: 0px;
			margin: 0px;
		}
		
		.bodybg {
			background: <?php echo $bgcolor; ?>
			filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='<?php echo $bgcolor; ?>', endColorstr='#FFFFFF');
			background: -webkit-gradient(linear, left top, left bottom, from(<?php echo $bgcolor; ?>), to(#FFFFFF));
			background: -moz-linear-gradient(top,  <?php echo $bgcolor ?>,  #FFFFFF);
			width:100%;
			height: 600px;
		}
	</style>

</head>

<body>

	<div align="center" class="bodybg">

		<?php include('main_header.php'); ?>

		<?php include('botonera.php'); ?>
		
		<?php
		
			$authors = NULL;
			$cantAuthors = 0;
		 
		 	$search = getValor('search');
			
			$start = getValor('start');
			
			if (strlen($search) == 0) {
				$start = 'true';
			} else if ($start == '') {
				$start = 'false';
			}

			$authors = obtenerAuthorsPorCongressYNombre($_SESSION['idcongress'], $search, $start);
			$cantAuthors = obtenerCantidadAuthorsPorCongressYNombre($_SESSION['idcongress'], $search, $start);
			
			if ($start == 'true') {
				$search = '';
			}
			
		?>

		<?php include('author_header.php'); ?>
		
		<div id="basic-accordian">
		
			<table bgcolor="#FFFFFF" width="100%" cellpadding="10">
				<tr>
					<td>
		
						<a href="author_search.php?search=A&start=true">A</a> |
						<a href="author_search.php?search=B&start=true">B</a> |
						<a href="author_search.php?search=C&start=true">C</a> |
						<a href="author_search.php?search=D&start=true">D</a> |
						<a href="author_search.php?search=E&start=true">E</a> |
						<a href="author_search.php?search=F&start=true">F</a> |
						<a href="author_search.php?search=G&start=true">G</a> |
						<a href="author_search.php?search=H&start=true">H</a> |
						<a href="author_search.php?search=I&start=true">I</a> |
						<a href="author_search.php?search=J&start=true">J</a> |
						<a href="author_search.php?search=K&start=true">K</a> |
						<a href="author_search.php?search=L&start=true">L</a> |
						<a href="author_search.php?search=M&start=true">M</a> |
						<a href="author_search.php?search=N&start=true">N</a> |
						<a href="author_search.php?search=O&start=true">O</a> |
						<a href="author_search.php?search=P&start=true">P</a> |
						<a href="author_search.php?search=Q&start=true">Q</a> |
						<a href="author_search.php?search=R&start=true">R</a> |
						<a href="author_search.php?search=S&start=true">S</a> |
						<a href="author_search.php?search=T&start=true">T</a> |
						<a href="author_search.php?search=U&start=true">U</a> |
						<a href="author_search.php?search=V&start=true">V</a> |
						<a href="author_search.php?search=W&start=true">W</a> |
						<a href="author_search.php?search=X&start=true">X</a> |
						<a href="author_search.php?search=Y&start=true">Y</a> |
						<a href="author_search.php?search=Z&start=true">Z</a>
					
					</td>
				</tr>
			</table>
						
			<?php  if ($cantAuthors > 0) { ?>				
		
				<?php 
				
					$uncolor = "#FFFFFF";
					$otrocolor = "#F8F8F8";
					$bgcolortr = $uncolor;
				
				?>
		
				<?php while ($row_author = mysql_fetch_assoc($authors)) { ?>

					<table width="100%" cellpadding="10" cellspacing="0">
						<tr bgcolor="<?php echo $bgcolortr; ?>" style="height: 25px;">
							<td>
								<a href="abstract_list.php?search=<?php echo $row_author['ID_AUTHOR']; ?>&author=author"
									 title="View <?php echo $row_author['NAME']; ?> Abstracts">
									<?php echo $row_author['NAME']; ?>
								</a>
							</td>
						</tr>									
					</table>

					<?php if ($bgcolortr == $uncolor) { $bgcolortr = $otrocolor; } else { $bgcolortr = $uncolor; } ?>

				<?php } ?>

			<?php } else { ?>
			
			<table bgcolor="#FFFFFF" width="100%" cellpadding="10">
				<tr><td>No authors found</td></tr>
			</table>
			
			<?php } ?>

		</div>
		
	</div>

</body>
</html>
